package com.edt.ichannel.api.controller;


import com.alibaba.fastjson.JSONObject;

import com.edt.ichannel.api.common.controller.BaseController;
import com.edt.ichannel.api.common.entity.ActionResult;
import com.edt.ichannel.api.entiy.local.EntityForDevelopMenterSyncReq;
import com.edt.ichannel.api.service.EdtApiService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 集团集中渠道接口
 */
@Controller
@RequestMapping("/developMenterSync")
public class DevelopMenterSyncController extends BaseController {

    @Resource
    private EdtApiService edtApiService;

    /**
     * 注册
     */
    @RequestMapping(value = "regist",method = RequestMethod.POST)
    @ResponseBody
    public void regist(@RequestBody String json) {
       EntityForDevelopMenterSyncReq entityForDevelopMenterSyncReq = JSONObject.parseObject(json,EntityForDevelopMenterSyncReq.class);
       ActionResult result = edtApiService.developMenterSyncRegist(entityForDevelopMenterSyncReq);
       WriterToPageByJson(result);
    }
    /**
     * 修改
     */
    @RequestMapping(value = "update",method = RequestMethod.POST)
    @ResponseBody
    public void update(@RequestBody String json) {
        EntityForDevelopMenterSyncReq entityForDevelopMenterSyncReq = JSONObject.parseObject(json,EntityForDevelopMenterSyncReq.class);
        ActionResult result = edtApiService.developMenterSyncUpdate(entityForDevelopMenterSyncReq);
        WriterToPageByJson(result);
    }
    /**
     * 注册
     */
    @RequestMapping(value = "cancel",method = RequestMethod.POST)
    @ResponseBody
    public void cancel(@RequestBody String json) {
        EntityForDevelopMenterSyncReq entityForDevelopMenterSyncReq = JSONObject.parseObject(json,EntityForDevelopMenterSyncReq.class);
        ActionResult result = edtApiService.developMenterSyncCancel(entityForDevelopMenterSyncReq);
        WriterToPageByJson(result);
    }

}
